/**
 * 
 */
package design_pattern.iterator;

/**
 * @author linzq
 * 
 */
public class ConcreteAggregate extends Aggregate {

  private Object[] objs = {"Monk Tang", "Monkey", "Pigsy", "Sandy", "Horse"};

  @Override
  public Iterator iterator() {
    return new ConcreteIterator(this);
  }

  public Object getElement(int index) {
    if (index < objs.length) {
      return objs[index];
    }
    return null;
  }

  public int size() {
    return objs.length;
  }

}
